home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / SmallEiffel 0.3.3 / SmallEiffel 68k / lib_test / test_string3.e < prev    next >
Encoding:
Text File  |  1996-06-13  |  808 b   |  43 lines  |  [TEXT/EDIT]

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_STRING1
  5.    
  6. creation make
  7.    
  8. feature 
  9.    
  10.    make is
  11.       local
  12.      s: STRING;
  13.      p: POINTER;
  14.       do
  15.      p := ("foo").to_external;
  16.      !!s.from_external(p);
  17.      is_true(s.count = 3);
  18.      is_true(equal("foo",s));
  19.  
  20.      p := ("").to_external;
  21.      !!s.from_external(p);
  22.      is_true(s.count = 0);
  23.      is_true(equal("",s));
  24.  
  25.      is_true(("AbCdeFZ+").same_as("abcdefz+"));
  26.       end;
  27.    
  28.    is_true(b: BOOLEAN) is
  29.       do
  30.      cpt := cpt + 1;
  31.      if not b then
  32.         std_output.put_string("TEST_STRING3: ERROR Test # ");
  33.         std_output.put_integer(cpt);
  34.         std_output.put_string("%N");
  35.      else
  36.         -- std_output.put_string("Yes %N");
  37.      end;
  38.       end;
  39.    
  40.    cpt: INTEGER;
  41.    
  42. end -- TEST_STRING3
  43.